|
|
|
|
|
|
|
In the preceding example, the field1, field2 list contains the list of fields in the SourceTable that is copied to the DestinationTable. If you want to copy all the columns from the source to the destination, you can use the asterisk wildcard (*) character for the field list. Enter the SQL-VB5 script in Listing 15.8 as SQLVB07.SQV. Save and execute the script, and check your on-screen results against those in Figure 15.9. |
|
|
|
|
|
|
|
|
Listing 15.8. Testing Make Table queries. |
|
|
|
|
|
|
|
|
//
// sqlvb07.sqv - Testing Make Table Queries
//
// create a database
dbMake sqlvb07.mdb;
// create a base table
CREATE TABLE BaseTable
(CustID TEXT(10) CONSTRAINT PKBaseTable PRIMARY KEY,
CustName TEXT(30),
CustBalance CURRENCY,
CustType TEXT(10),
Notes MEMO
);
// add some data
INSERT INTO BaseTable VALUES
('CUST01',
'Willingham & Associates',
'300.65',
'RETAIL',
'This is a comment'
);
INSERT INTO BaseTable VALUES
('CUST02',
'Parker & Parker',
'1000.29',
'WHOLESALE',
'This is another comment'
);
INSERT INTO BaseTable VALUES
('CUST03',
'Anchor, Smith, & Hocking',
'575.25',
'RETAIL',
'This is the last comment'
);
// now make a new table from the old one
SELECT * INTO CopyTable FROM BaseTable;
// show results
SELECT * FROM BaseTable;
SELECT * FROM CopyTable;
// eof |
|
|
|
|
|